{extend name='admin@public/content'}

{block name="button"}

<!--{if auth("$classuri/del")}-->
<button data-update data-field='delete' data-action='{:url("$classuri/del")}' class='layui-btn layui-btn-sm layui-btn-primary'>取消代理商</button>
<!--{/if}-->
{/block}

{block name="content"}

<!-- 表单搜索 开始 -->
<form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get">

    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">代理商ID</label>
        <div class="layui-input-inline">
            <input name="agent_id" value="{$Think.get.agent_id|default=''}" placeholder="请输入代理商ID" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">代理商名称</label>
        <div class="layui-input-inline">
            <input name="name" value="{$Think.get.name|default=''}" placeholder="请输入代理商名称" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">创建时间</label>
        <div class="layui-input-inline">
            <input name="date" id='range-date' value="{$Think.get.date|default=''}" placeholder="请选择创建时间" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item layui-inline">
        <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
    </div>

</form>
<script>
    window.laydate.render({range: true, elem: '#range-date'});
</script>
<!-- 表单搜索 结束 -->

<form onsubmit="return false;" data-auto="true" method="post">
    <!--{empty name='list'}-->
    <p class="help-block text-center well">没 有 记 录 哦！</p>
    <!--{else}-->
    <input type="hidden" value="resort" name="action">
    <table class="layui-table" lay-skin="line">
        <thead>
        <tr>
            <th class='list-table-check-td'>
                <input data-auto-none="" data-check-target='.list-check-box' type='checkbox'>
            </th>
            <th class='text-left nowrap'>代理商ID</th>
            <th class='text-left nowrap'>代理商名称</th>
            <th class='text-left nowrap'>代理级别</th>
            <th class='text-left nowrap'>手机号</th>
            <th class='text-left nowrap'>注册/审核时间</th>
            <th class='text-left nowrap'>审核状态</th>
            <th class='text-left nowrap'>代理状态</th>
            <th class='text-left nowrap'>操作</th>
        </tr>
        </thead>
        <tbody>
        <!--{foreach $list as $key=>$vo}-->
        <tr>
            <td class='list-table-check-td'>
                <input class="list-check-box" value='{$vo.agent_id}' type='checkbox'>
            </td>
            <td class='text-left nowrap'>
                {$vo.agent_id}
            </td>
            <td class='text-left nowrap'>
                <img data-tips-image="" class="img" src="{$vo.ewm_url}" title="" style="">
                {$vo.name}
            </td>
            <td class='text-left nowrap'>
                {$vo.level_name}
            </td>
            <td class='text-left nowrap'>
                {$vo.mobile}
            </td>
            <td class='text-left nowrap'>
                {$vo.create_at}/{$vo.examine_at}
            </td>
            <td class='text-left nowrap'>
                {switch name='vo.status'}
                {case value='0'}<span class="layui-badge layui-bg-gray">待审核</span>{/case}
                {case value='1'}<span class="layui-badge layui-bg-blue">已通过</span>{/case}
                {case value='2'}<span class="layui-badge layui-bg-red">拒绝</span>{/case}
                {/switch}
            </td>
            <td class='text-left nowrap'>

                <!--{if $vo.status eq 1 and $vo.is_deleted eq 0}-->
                    <span class="layui-badge layui-bg-blue">正常</span>
                <!--{/if}-->
                <!--{if $vo.is_deleted eq 1}-->
                    <span class="layui-badge layui-bg-gray">已取消</span>
                <!--{/if}-->

            </td>

            <td class='text-left nowrap'>
                {if auth("$classuri/operate")}
                <span class="text-explode">|</span>
                <a data-title="操作" data-modal='{:url("$classuri/operate")}?id={$vo.agent_id}'><span class="layui-badge">操作</span></a>
                {/if}

                <!--{if $vo.status eq 1 and $vo.is_deleted eq 0 and auth("$classuri/makeCode")}-->
                <!--<span class="text-explode">|</span>-->
                <!--<a data-update="{$vo.agent_id}" data-field='ewm_url' data-value='' data-action='{:url("$classuri/makeCode")}'>生成二维码</a>-->
                <!--{/if}-->

                <!--{if $vo.status eq 1 and $vo.is_deleted eq 1 and auth("$classuri/recover")}-->
                <span class="text-explode">|</span>
                <a data-update="{$vo.agent_id}" data-field='is_deleted' data-value='0' data-action='{:url("$classuri/recover")}'>恢复代理</a>
                <!--{/if}-->
            </td>
        </tr>
        <!--{/foreach}-->
        </tbody>
    </table>
    {if isset($page)}<p>{$page|raw}</p>{/if}
    <!--{/empty}-->
</form>
<style>
    .img {
        width: 25px;
        height: 25px;
        /*border-radius: 50%;*/
        margin-right: 10px;
    }

</style>
{/block}